Add polling interval service and setting available through zwave node entity panel#9056
Conversation
|
@turbokongen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @armills, @balloob and @andrey-git to be potential reviewers. |
|
On HA restart the poll value will get back to the config setting |
|
Yes, we can ofcourse remove everything all together, and make every config that has polling_intensity set fail, or we can leave both, and let users migrate. I can add a warning to be printed for each config line set. |
|
I don't see a migration path here. Why have this runtime-controlled anyway? |
|
Isn't it wanted to be able to set/remove polling without a restart of the whole server? |
|
It is definetly a plus, but if the value is not retained across a restart, then it's a step back. |
|
You are completely right @andrey-git |
Changes for: home-assistant/core#9056
|
OK, this is better now. |
|
@turbokongen @andrey-git please consider the following possible scenario: a system crashes for whatever reasons. With automatic deployments u redeploy the app very simple and have everything working again instantly; by moving configuration things to UI (like u did with the entire zwave node id namings) which indeed need to be setup only once in the UI) u're asking that user to reconfigure manually from UI everything. You're moving from hardcoded controllable configuration deployed files used in automated deployments to manual labor configurations from UI. Is this the wanted behavior and/or direction ? |
|
@rofrantz All the information you mention is stored in zwcfg[home_id].xml |
|
Thanks @turbokongen that's indeed a solution too. But I guess that will work. |
|
Another point is that That's also the reason I disliked the IDs change - I don't want to depend on zwcfg. |
|
@andrey-git I didn't wanna raise the dead, but as @turbokongen once said "it is decided, and it is done" :) |
|
Since zwave devices have only a handful config attributes and two of them (ignore and poll) are already in UI config editor, I think a better solution would be to implement the rest of them in the UI. That said, changing poll interval should also call the new service - updating the device live, but in addition saving this into the config, thus not relying on zwcfg. |
There was a problem hiding this comment.
block comment should start with '# '
|
I'm torn in how to implement this. To be able to do both the live and the config file updates, we need the entity_id together with the value_id. I can't seem to find one place where both are present, so this first draft is accessing a protected member to generate the entity_id in the value-view api. Please comment and suggest, as this is the best I could come up with at this moment. 😢 |
7cf90f2 to
89c0126
Compare
89c0126 to
95257dd
Compare
95257dd to
088e0c4
Compare
088e0c4 to
22339d4
Compare
22339d4 to
335f556
Compare
|
Ping? |
emlove
left a comment
There was a problem hiding this comment.
Looks reasonable to me. Just one question.
| if polling_intensity: | ||
| self.primary.enable_poll(polling_intensity) | ||
| else: | ||
| self.primary.disable_poll() |
There was a problem hiding this comment.
Question: Is polling disabled by default, and that's why this was removed?
There was a problem hiding this comment.
Polling is always set to 0 by OZW unless it is set to something different by user to the value_id.
So if there is no entry for polling, in either the homeassistant config or the zwcfg, no polling is set.
There was a problem hiding this comment.
There was a problem hiding this comment.
Appreciate it 🥇
|
So if I understand correctly: For users who have poll intensity defined in the config: Using the UI will take effect but on restart it will fall back to the config value. For users without poll intensity in the config: Poll intensity is stored in zwcfg |
|
Why can't we do both, we store it both in the config and make it take effect right away? And in the future we add a checkbox to do it temporarily only (and not write it to config). |
|
When using the Frontend editor, it sets both the live value and saves to the configuration. If only using the service, that is temporary. |
* Update z-wave.markdown Changes for: home-assistant/core#9056 * Update z-wave.markdown * Update z-wave.markdown * Update z-wave.markdown
Description:
Let's user set polling interval during runtime.

Moves polling and ignore into node entity card.
This will also save to the zwave_device_config.yaml file.
Tied with: home-assistant/frontend#402